<template>
  <div>
    <el-form :model="projectForm" ref="projectForm">
      <el-form-item label="项目名称">
        <el-input v-model="projectForm.projectName"></el-input>
      </el-form-item>
      <el-form-item label="立项日期">
        <el-date-picker v-model="projectForm.startDate" type="date" placeholder="选择日期"></el-date-picker>
      </el-form-item>
      <el-form-item label="项目编号">
        <el-input v-model="projectForm.projectNumber"></el-input>
      </el-form-item>
      <el-form-item label="预算文号">
        <el-input v-model="projectForm.budgetDocumentNumber"></el-input>
      </el-form-item>
      <el-form-item label="项目经理">
        <el-input v-model="projectForm.projectManager"></el-input>
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="projectForm.remarks"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="handleSubmit">提交</el-button>
        <el-button @click="handleCancel">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      projectForm: {
        projectName: '',
        startDate: '',
        projectNumber: '',
        budgetDocumentNumber: '',
        projectManager: '',
        remarks: ''
      }
    }
  },
  methods: {
    handleSubmit() {
      // 提交表单数据
      this.$http.post('/project/add', this.projectForm).then(() => {
        this.$router.push('/project/list');
      });
    },
    handleCancel() {
      // 取消表单操作
      this.$router.push('/project/list');
    }
  }
}
</script>

<style scoped>

</style>